package mao.thinkinjava.concurency.myenum;

import java.util.EnumSet;

enum AlarmPoints {
    STAIR1,STAIR2, KITCHEN,OFFICE1,OFFICE2;
}
public class EnumSetTest{
    public static void main(String[] args) {
        EnumSet<AlarmPoints> points = EnumSet.noneOf(AlarmPoints.class);
        System.out.println(points);
        points.add(AlarmPoints.OFFICE1);
        System.out.println(points);
        points.addAll(EnumSet.range(AlarmPoints.STAIR2,AlarmPoints.OFFICE2));
        System.out.println(points);
    }

}
